//
//  UgcFriendsTbv.m
//  ZITHER
//
//  Created by weixin on 2018/9/10.
//  Copyright © 2018年 weixn. All rights reserved.
//

#import "Ugc_Friends_Tbv_WX.h"

#import "Ugc_Friends_OnePicCell_WX.h"
#import "Ugc_Friends_FourPicCell_WX.h"
#import "Ugc_Friends_MorePicCell_WX.h"
#import "MainFirst_MagazineList_PGCCell_WX.h"
#import "MainFirst_MagazineList_UgcCell_WX.h"

#import "MainFirst_Magazine_VC_WX.h"
#import "Ugc_Detail_VC_WX.h"
#import "UgcMainModel.h"

@implementation Ugc_Friends_Tbv_WX

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self defaultConfiguration];
    }
    return self;
}

-(void)setIndexType:(NSString *)indexType{
    _indexType = indexType;
    [self.mj_header beginRefreshing];
}

-(void)loadData:(BOOL)type{
    @weakify(self);

    if ([self.indexType isEqualToString:@"2"]) {
        [[serviceDefualt loadGetuserUgcList:@"" isEssence:self.indexType page:self.page reponseObjctClass:[UgcMainModel class]]subscribeNext:^(ResponseData * x) {
            @strongify(self);
            if (x.success) {
                
                NSArray *arr1 = x.responseRawData[@"data"][@"list"];
                
                if (arr1.count == 0) {
                    if (self.page == 0) {
                        [Tools showTips:@"暂无更多数据"];
                        [self.mj_header endRefreshing];
                        [self.mj_footer endRefreshing];
                    }else{
                        [self.mj_footer endRefreshingWithNoMoreData];
                    }
                    return ;
                }
                
                UgcMainModel *model = x.responseData;
                NSArray *arr = model.list;
                
                if (type) {
                    self.arrM = [[NSMutableArray alloc]init];
                    [[SDImageCache sharedImageCache] clearMemory];
                    if (arr.count == 0 ) {
                        [Tools showTips:@"暂无更多数据"];
                    }else{
                        for (UgcMainModel *model in arr) {
                            [self.arrM addObject: model];
                        }
                        [self reloadData];
                    }
                }else{
                    if (arr.count == 0 ) {
                        if (!self.mj_header.refreshing) {
                            [Tools showTips:@"暂无更多数据"];
                        }
                    }else{
                        for (UgcMainModel *model in arr) {
                            [self.arrM addObject: model];
                        }
                        [self reloadData];
                    }
                }
                
            }else{
                [Tools showTips:x.errorInfo];
            }
            [self.mj_header endRefreshing];
            [self.mj_footer endRefreshing];
            
        }];
    }else if([self.indexType isEqualToString:@"1"]){
        @weakify(self);
        /** PGC列表（杂志）*/
        [[serviceDefualt loadUserPgcListPage:self.page reponseObjctClass:[CoverCreateListModel class]]subscribeNext:^(ResponseData * x) {
            @strongify(self);
            if (x.success) {
                
                CoverCreateListModel * model = [[CoverCreateListModel alloc]init];
                model.recommend = @"0";
                CoverResultModelSub *mdoel1 = [CoverResultModelSub yy_modelWithDictionary:x.responseRawData[@"data"]];
                model.result = mdoel1;
//                NSMutableArray <CoverCreateListModelSub*>* list = [CoverCreateListModelSub yy_modelWithDictionary:x.responseRawData[@"data"][@"list"]];
////                model1.result =
//
//                CoverCreateListModel * model = model;
                
                if (model.result.list.count == 0) {
                    
                    if (self.page == 0 ) {
                        self.model.result.list = [[NSMutableArray alloc]init];
                        [Tools showTips:@"暂无更多数据"];
                        [self reloadData];
                        [self endRefreshing];
                        
                    }else{
                        [self.mj_footer endRefreshingWithNoMoreData];
                    }
                    return ;
                    
                }else{
                    if (self.page == 0) {
                        self.model = model;
                    }else{
                        for (CoverCreateListModelSub *modelSub in model.result.list) {
                            [self.model.result.list addObject:modelSub];
                        }
                    }
                }
                [self endRefreshing];
                [self reloadData];
            }else{
                [Tools showTips:x.errorInfo];
                [self endRefreshing];
            }
        }];
    }else{
        @weakify(self);
        /** 我关注的创作列表 */
        [[serviceDefualt loadMySelfFollowCreateListPage:self.page reponseObjctClass:[CoverCreateListModel class]]subscribeNext:^(ResponseData * x) {
            @strongify(self);
	            if (x.success) {
                CoverCreateListModel * model = x.responseData;
                if (model.result.list.count == 0) {
                    
                    if (self.page == 0 ) {
                        self.model.result.list = [[NSMutableArray alloc]init];
                        [Tools showTips:@"暂无更多数据"];
                        [self reloadData];
                        [self endRefreshing];
                    }else{
                        [self.mj_footer endRefreshingWithNoMoreData];
                    }
                    return ;
                    
                }else{
                    if (self.page == 0) {
                        self.model = model;
                    }else{
                        for (CoverCreateListModelSub *modelSub in model.result.list) {
                            [self.model.result.list addObject:modelSub];
                        }
                    }
                }
                [self setHeadView];
                [self endRefreshing];
                [self reloadData];
            }else{
                
                if ([x.errorInfo isEqualToString:@"未登录"]) {
                    
                }else{
                    [Tools showTips:x.errorInfo];
                    [self endRefreshing];
                }
                
            }
        }];
        
    
    }

}


-(void)setHeadV{
    
}

-(void)endRefreshing{
    [self.mj_header endRefreshing];
    [self.mj_footer endRefreshing];
}

-(void)defaultConfiguration{
    
    self.delegate = self;
    self.dataSource = self;
    self.separatorStyle = UITableViewCellSeparatorStyleNone;
    self.rowHeight = UITableViewAutomaticDimension;
    self.estimatedRowHeight = 1000;
    [self registerNib:[UINib nibWithNibName:@"UgcFriendsTbvCell" bundle:nil] forCellReuseIdentifier:@"UgcFriendsTbvCell"];
    [self registerNib:[UINib nibWithNibName:@"Ugc_Friends_OnePicCell_WX" bundle:nil] forCellReuseIdentifier:@"Ugc_Friends_OnePicCell_WX"];
    [self registerNib:[UINib nibWithNibName:@"Ugc_Friends_FourPicCell_WX" bundle:nil] forCellReuseIdentifier:@"Ugc_Friends_FourPicCell_WX"];
    [self registerNib:[UINib nibWithNibName:@"Ugc_Friends_MorePicCell_WX" bundle:nil] forCellReuseIdentifier:@"Ugc_Friends_MorePicCell_WX"];
    [self registerNib:[UINib nibWithNibName:@"MainFirst_MagazineList_PGCCell_WX" bundle:nil] forCellReuseIdentifier:@"MainFirst_MagazineList_PGCCell_WX"];
    [self registerNib:[UINib nibWithNibName:@"MainFirst_MagazineList_UgcCell_WX" bundle:nil] forCellReuseIdentifier:@"MainFirst_MagazineList_UgcCell_WX"];


    @weakify(self);
    self.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
        @strongify(self);
        self.page = 0;
        [self loadData:YES];
    }];

    self.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
        @strongify(self);
        self.page ++;
        [self loadData:NO];
    }];
    
}

-(void)setHeadView{
    
    if ([self.indexType isEqualToString:@"0"]) {
        if ( [self.model.recommend isEqualToString:@"1"]) {
            if (kUSER_INFO_MANAGER.userIsLogin) {
                [self.headView isType:0];
            }else{
                [self.headView isType:1];
            }
            
        }else{
            [self.headView isType:2];
        }
        self.tableHeaderView = self.headView;
        [self reloadData];
        return;
    }
    self.tableHeaderView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 0, 1)];

}

#pragma MARK - 数据源
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    
    if (![self.indexType isEqualToString:@"2"]) {
        return self.model.result.list.count;
    }
    return self.arrM.count;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    if ([self.indexType isEqualToString:@"2"]) {
        UgcMainListModel *model = self.arrM[indexPath.row];
        
        if (model.fileList.count == 1) {
            return [self getFriendsOneCell:indexPath];
        }else if(model.fileList.count == 4){
            return [self getFriendsFourPicCell:indexPath];
        }else{
            return [self getFriendsMorePicCell:indexPath];
        }
        
    }else{
        
        if ([self.indexType isEqualToString:@"1"]) {
            
            return [self getMainFirst_MagazineList_PGCCell_WX:indexPath];
            
        }else{
            
            CoverCreateListModelSub *modelSub = self.model.result.list[indexPath.row];
            
//            if ([modelSub.relType isEqualToString:@"1"]) {
//                if (![self.model.recommend isEqualToString:@"1"]) {
//
//                }
//            }else{
//
//            }
        //是否登录
        //属于ugc 还是pgc
        //属于系统还是普通
            
            if ([modelSub.relType isEqualToString:@"2"]) {
                return [self getMainFirst_MagazineList_PGCCell_WX:indexPath];
            }else{
                if (kUSER_INFO_MANAGER.userIsLogin && [self.model.recommend isEqualToString:@"1"]) {
                    //登录情况下判断 rem
                    return [self getMainFirst_MagazineList_UgcCell_WX:indexPath];
                }else{
                    //未登录情况下
                    //已经登录情况
                    //判断是否是系统d推荐
//                    if (![self.model.recommend isEqualToString:@"1"]) {
                        if (modelSub.ugcFileList.count == 1) {
                            return [self getFriendsOneCell:indexPath];
                        }else if(modelSub.ugcFileList.count == 4){
                            return [self getFriendsFourPicCell:indexPath];
                        }else{
                            return [self getFriendsMorePicCell:indexPath];
                        }
//                    }
                }

            }
            
          
//            if ([self.model.recommend isEqualToString:@"1"]) {
//
//                if ([modelSub.relType isEqualToString:@"2"]) {
//
//
//                    //展示系统推荐pgc
//                    if (kUSER_INFO_MANAGER.userIsLogin) {
//                        //展示系统推荐的
//                    }else{
//                    }
//                }else{
//
//                }
//            }else{
//                return [self getMainFirst_MagazineList_PGCCell_WX:indexPath];
//            }
            
//
//
//            if ([self.model.recommend isEqualToString:@"1"]) {
//
//
//
//
//                if ([modelSub.relType isEqualToString:@"2"]) {
//
//                    return [self getMainFirst_MagazineList_PGCCell_WX:indexPath];
//
//                }else{
//                    if (kUSER_INFO_MANAGER.userIsLogin) {
//                    return [self getMainFirst_MagazineList_UgcCell_WX:indexPath];
//                    }else{
//                        if ([modelSub.relType isEqualToString:@"2"]) {
//                            return [self getMainFirst_MagazineList_PGCCell_WX:indexPath];
//                        }else{
//
//                            if (modelSub.ugcFileList.count == 1) {
//                                return [self getFriendsOneCell:indexPath];
//                            }else if(modelSub.ugcFileList.count == 4){
//                                return [self getFriendsFourPicCell:indexPath];
//                            }else{
//                                return [self getFriendsMorePicCell:indexPath];
//                            }
//                        }
//                    }
//
//                }
//
//            } else {
//                if ([modelSub.relType isEqualToString:@"2"]) {
//                    return [self getMainFirst_MagazineList_PGCCell_WX:indexPath];
//                }else{
//
//                    if (modelSub.ugcFileList.count == 1) {
//                        return [self getFriendsOneCell:indexPath];
//                    }else if(modelSub.ugcFileList.count == 4){
//                        return [self getFriendsFourPicCell:indexPath];
//                    }else{
//                        return [self getFriendsMorePicCell:indexPath];
//                    }
//                }
//            }
//
//
            
        }
        //        relType
        return nil;
    }
}


-(MainFirst_MagazineList_UgcCell_WX*)getMainFirst_MagazineList_UgcCell_WX:(NSIndexPath*)indexPath{
    CoverCreateListModelSub *modelSub = self.model.result.list[indexPath.row];
    
    static NSString *sectionCell = @"MainFirst_MagazineList_UgcCell_WX";
    MainFirst_MagazineList_UgcCell_WX *cell = [self dequeueReusableCellWithIdentifier:sectionCell];
    if (cell == nil) {
        cell = [[MainFirst_MagazineList_UgcCell_WX alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:sectionCell];
    }
    cell.selectionStyle = UITableViewCellSeparatorStyleNone;
    if (kUSER_INFO_MANAGER.userIsLogin) {
        cell.recommend = @"1";
    }else{
        cell.recommend = self.model.recommend;
    }
    cell.model = modelSub;
    return cell;
}
    



-(MainFirst_MagazineList_PGCCell_WX*)getMainFirst_MagazineList_PGCCell_WX:(NSIndexPath*)indexPath{
    
    CoverCreateListModelSub *modelSub = self.model.result.list[indexPath.row];

    static NSString *sectionCell = @"MainFirst_MagazineList_PGCCell_WX";
    MainFirst_MagazineList_PGCCell_WX *cell = [self dequeueReusableCellWithIdentifier:sectionCell];
    if (cell == nil) {
        cell = [[MainFirst_MagazineList_PGCCell_WX alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:sectionCell];
    }
    cell.selectionStyle = UITableViewCellSeparatorStyleNone;
    
    if ([self.indexType isEqualToString:@"0"])
    {
        if (kUSER_INFO_MANAGER.userIsLogin) {
            
            if ([self.model.recommend isEqualToString:@"0"]) {
                cell.recommend = @"2";
            }else{
                cell.recommend = @"1";
            }

        }else{
            cell.recommend = @"2";
        }
    }else{
        cell.recommend = self.model.recommend;
    }
    cell.model = modelSub;
    return cell;
}


-(Ugc_Friends_OnePicCell_WX*)getFriendsOneCell:(NSIndexPath*)indexPath{
   
    static NSString *OnePicCell = @"Ugc_Friends_OnePicCell_WX";
    Ugc_Friends_OnePicCell_WX *cell = [self dequeueReusableCellWithIdentifier:OnePicCell];
    if (cell == nil) {
        cell = [[Ugc_Friends_OnePicCell_WX alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:OnePicCell];
    }
    cell.selectionStyle = UITableViewCellSeparatorStyleNone;
    if ([self.indexType isEqualToString:@"2"]) {
        UgcMainListModel *model = self.arrM[indexPath.row];
        cell.model = model;
    }else{
        CoverCreateListModelSub *modelSub = self.model.result.list[indexPath.row];
        cell.modelSub = modelSub;
    }
   
    return cell;
}

-(Ugc_Friends_FourPicCell_WX*)getFriendsFourPicCell:(NSIndexPath*)indexPath{

    static NSString *fourPicCell = @"Ugc_Friends_FourPicCell_WX";
    Ugc_Friends_FourPicCell_WX *cell = [self dequeueReusableCellWithIdentifier:fourPicCell];
    if (cell == nil) {
        cell = [[Ugc_Friends_FourPicCell_WX alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:fourPicCell];
    }
    
    @weakify(cell);
    
    @weakify(self);
    
    [cell setShowBigPic:^(NSIndexPath * _Nonnull indexPath, NSUInteger index) {
        @strongify(cell);
        @strongify(self);
        self.type = NO;
        [self.arrImageView removeAllObjects];
        [self.arrImageUrl removeAllObjects];
        
        self.arrZipImageView = cell.arrImageView;
        
        for (int i = 0; i<cell.model.fileList.count; i++) {
            NSString *str = [NSString stringWithFormat:@"%@%@",RootUrlImage,cell.model.fileList[i]];
            UIImageView *imageV = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 50, 50)];
            [imageV sd_setImageWithURL:[NSURL URLWithString:str] placeholderImage:[UIImage imageNamed:@"ucg_img_loding"]];
            [self.arrImageView addObject:imageV];
            [self.arrImageUrl addObject:str];
        }
        
        [self showBigImage:index];
    }];
    
    cell.indexPath = indexPath;
    
    cell.selectionStyle = UITableViewCellSeparatorStyleNone;
    
    if ([self.indexType isEqualToString:@"2"]) {
        UgcMainListModel *model = self.arrM[indexPath.row];
        cell.model = model;
    }else{
        CoverCreateListModelSub *modelSub = self.model.result.list[indexPath.row];
        cell.modelSub = modelSub;
    }
    return cell;
}

-(Ugc_Friends_MorePicCell_WX*)getFriendsMorePicCell:(NSIndexPath*)indexPath{
    static NSString *sectionCell = @"Ugc_Friends_MorePicCell_WX";
    //        NSLog(@" ========== %@",sectionCell);
    Ugc_Friends_MorePicCell_WX *cell = [self dequeueReusableCellWithIdentifier:sectionCell];
    if (cell == nil) {
        cell = [[Ugc_Friends_MorePicCell_WX alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:sectionCell];
    }
    cell.indexPath = indexPath;
    @weakify(cell);
    @weakify(self);
    [cell setShowBigPic:^(NSIndexPath * _Nonnull indexPath, NSUInteger index) {
        @strongify(cell);
        @strongify(self);
        self.type = NO;
        [self.arrZipImageView removeAllObjects];
        [self.arrImageView removeAllObjects];
        [self.arrImageUrl removeAllObjects];
        
        for (int i = 0; i<cell.model.fileList.count; i++) {
            NSString *str = [NSString stringWithFormat:@"%@%@",RootUrlImage,cell.model.fileList[i]];
            UIImageView *imageV = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 50, 50)];
            [imageV sd_setImageWithURL:[NSURL URLWithString:str] placeholderImage:[UIImage imageNamed:@"ucg_img_loding"]];
            [self.arrImageView addObject:imageV];
            [self.arrImageUrl addObject:str];
            [self.arrZipImageView addObject:cell.arrImageView[i]];
        }
        
        [self showBigImage:index];
    }];
    cell.selectionStyle = UITableViewCellSeparatorStyleNone;
    if ([self.indexType isEqualToString:@"2"]) {
        UgcMainListModel *model = self.arrM[indexPath.row];
        cell.model = model;
    }else{
        CoverCreateListModelSub *modelSub = self.model.result.list[indexPath.row];
        cell.modelSub = modelSub;
        
    }    return cell;
}




- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    if ([self.indexType isEqualToString:@"2"]) {
        
        UgcMainListModel *model = self.arrM[indexPath.row];
        Ugc_Detail_VC_WX *vc = [[Ugc_Detail_VC_WX alloc]init];
        vc.ugcId = model.ugcId;
        vc.userID = model.userId;
        [vc setBlockDel:^{
            [self.arrM removeObjectAtIndex:self.selectCellIndexPath];
            [self deleteRowsAtIndexPaths:@[indexPath]  withRowAnimation:UITableViewRowAnimationFade];
        }];
        [self.getNav pushViewController:vc animated:YES];
        
    }else{
        if ([self.indexType isEqualToString:@"1"]) {
            
            CoverCreateListModelSub *modelSub = self.model.result.list[indexPath.row];
            MainFirst_Magazine_VC_WX *vc = [[MainFirst_Magazine_VC_WX alloc]init];
            vc.pgcId = modelSub.pgcId;
            [self.getNav pushViewController:vc animated:YES];
            
        }else{
            
            if ([self.indexType isEqualToString:@"2"]) {
                UgcMainListModel *model = self.arrM[indexPath.row];
                Ugc_Detail_VC_WX *vc = [[Ugc_Detail_VC_WX alloc]init];
                vc.ugcId = model.ugcId;
                vc.userID = model.userId;
                [self.getNav pushViewController:vc animated:YES];
            }else{
                if ([self.indexType isEqualToString:@"1"]) {
                    CoverCreateListModelSub *modelSub = self.model.result.list[indexPath.row];
                    MainFirst_Magazine_VC_WX *vc = [[MainFirst_Magazine_VC_WX alloc]init];
                    vc.pgcId = modelSub.pgcId;
                    [
                     self.getNav pushViewController:vc animated:YES];
                }else{
                    CoverCreateListModelSub *modelSub = self.model.result.list[indexPath.row];
                                        if ([modelSub.relType isEqualToString:@"2"]) {
                        MainFirst_Magazine_VC_WX *vc = [[MainFirst_Magazine_VC_WX alloc]init];
                        vc.pgcId = modelSub.relId;
                        [self.getNav pushViewController:vc animated:YES];
                        
                    }else{
                        Ugc_Detail_VC_WX *vc = [[Ugc_Detail_VC_WX alloc]init];
                        vc.ugcId = modelSub.relId;
                        vc.userID = modelSub.userId;
                        [self.getNav pushViewController:vc animated:YES];
                    }
                }
            }
        }
    }
}

-(QMUIImagePreviewViewController *)imagePreviewViewController{
    if (!_imagePreviewViewController) {
        _imagePreviewViewController = [[QMUIImagePreviewViewController alloc] init];
        _imagePreviewViewController.imagePreviewView.delegate = self;
    }
    return _imagePreviewViewController;
}

-(void)showBigImage:(NSInteger)selectIndex{
    UIImageView *imageV = self.arrZipImageView[selectIndex];
    @weakify(self);
    self.imagePreviewViewController.customGestureExitBlock = ^(QMUIImagePreviewViewController *aImagePreviewViewController, QMUIZoomImageView *currentZoomImageView) {
        @strongify(self);
        NSInteger index = aImagePreviewViewController.imagePreviewView.currentImageIndex;
        UIImageView *imageV1 = self.arrZipImageView[index];

        UIWindow * window=[[[UIApplication sharedApplication] delegate] window];
                CGRect rect=[imageV1 convertRect: imageV1.bounds toView:window];
        
        [aImagePreviewViewController exitPreviewToRectInScreenCoordinate:rect];
        self.imagePreviewViewController = nil;
    };
    self.imagePreviewViewController.imagePreviewView.currentImageIndex =  selectIndex;// 默认查看的图片的 index
    
    UIWindow * window=[[[UIApplication sharedApplication] delegate] window];
    
    CGRect rect=[imageV convertRect: imageV.bounds toView:window];
    
    [self.imagePreviewViewController startPreviewFromRectInScreenCoordinate:rect cornerRadius:imageV.layer.cornerRadius];
}


#pragma mark - <QMUIImagePreviewViewDelegate>

- (NSUInteger)numberOfImagesInImagePreviewView:(QMUIImagePreviewView *)imagePreviewView {
    return self.arrImageView.count;
}

- (void)imagePreviewView:(QMUIImagePreviewView *)imagePreviewView renderZoomImageView:(QMUIZoomImageView *)zoomImageView atIndex:(NSUInteger)index {
    // 模拟异步加载的情况
    zoomImageView.reusedIdentifier = @(index);
    [zoomImageView showLoading];
    if ([zoomImageView.reusedIdentifier isEqual:@(index)]) {
//        UIImageView *imageV = ;
        [self.arrImageView[index] sd_setImageWithURL:[NSURL URLWithString:self.arrImageUrl[index]] placeholderImage:[UIImage imageNamed:@"ucg_img_loding"] completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
            [zoomImageView hideEmptyView];
            zoomImageView.image = self.arrImageView[index].image;
            
        }];
    }

}

- (QMUIImagePreviewMediaType)imagePreviewView:(QMUIImagePreviewView *)imagePreviewView assetTypeAtIndex:(NSUInteger)index {
    return QMUIImagePreviewMediaTypeImage;
}

#pragma mark - <QMUIZoomImageViewDelegate>

- (void)singleTouchInZoomingImageView:(QMUIZoomImageView *)zoomImageView location:(CGPoint)location {
    //点击缩回
    self.imagePreviewViewController.customGestureExitBlock(self.imagePreviewViewController, zoomImageView);
    [self.arrImageView removeAllObjects];
    [self.arrImageUrl removeAllObjects];
    [[SDImageCache sharedImageCache] setValue:nil forKey:@"memCache"];

}



- (NSMutableArray<UIImageView *> *)arrImageView{
    if (!_arrImageView) {
        _arrImageView = [[NSMutableArray alloc]init];
    }
    return _arrImageView;
}

-(NSMutableArray *)arrZipImageView{
    if (!_arrZipImageView) {
        _arrZipImageView = [[NSMutableArray alloc]init];
    }
    return _arrZipImageView;
}

-(NSMutableArray *)arrImageUrl{
    if (!_arrImageUrl) {
        _arrImageUrl = [[NSMutableArray alloc]init];
        
    }
    return _arrImageUrl;
}

-(Ugc_Friends_TbvHead_WX *)headView{
    if (!_headView) {
        _headView = [[Ugc_Friends_TbvHead_WX alloc]initWithFrame:CGRectMake(0, 0, kScreenW, 200)];
    }
    return _headView;
}

@end
